﻿package com.air.swfmessengergui.display.publicidade
{
	
import flash.html.HTMLLoader;
import flash.display.Sprite;
import flash.events.Event;
import flash.net.URLRequest;
import flash.geom.Rectangle;

import com.air.swfmessengergui.SWFMessenger_gui;

public class GoogleAdsense extends Sprite
{
	var html:HTMLLoader;
	
	public function GoogleAdsense() {
		html = new HTMLLoader();
		html.width = 234;
		html.height = 60;
		addChild( html );
		addEventListener(Event.ADDED_TO_STAGE, added);
		
		try {
			html.load( new URLRequest("http://www.8arte.net/google/adsense/pagina.html") );
		} catch(e:Error) {
			//throw new Error ( "HTMLContentLoader erro abrindo: " + url +"\nDescrição do erro: " + e.toString() );
		}
	}
	
	private function sizer(e:Event):void {
		scrollRect = new Rectangle(0,0, SWFMessenger_gui(root).topMeio.width, 60);
		x = SWFMessenger_gui(root).baixoMeio.x;
		y = SWFMessenger_gui(root).baixoMeio.y+2;
	}
	
	private function added(e:Event):void {
		stage.addEventListener(Event.RESIZE, sizer);
		sizer(null);
		removeEventListener(Event.ADDED_TO_STAGE, added);
	}
}
}